<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta content="text/html; charset=UTF-8" http-equiv="content-type">
        <title> 统计 </title>

        <?php include VIEWS.'admin/style.html'?>
    </head>

    <body>

        <?php include VIEWS.'admin/head.html'?>

        <ul id="submenu">
            <li><a href='/admin/stat.php' class="current">商品销售排行</a></li>
            <li><a href='/admin/stat.php?show=MonthIndentCount'>订单数统计</a></li>
            <li><a href='/admin/stat.php?show=MonthIncome'>营业额统计</a></li>
        </ul>

        <div id="body">

            <div style="float:left;padding-left:10px">
                <b>按时间段：</b>
                <a href="stat.php?time=<?php echo date('Y-m-').'1'?>">本月排行</a> -
                <a href="stat.php?time=<?php echo date('Y-').'1-1'?>">本年排行</a> -
                <a href="stat.php?time=2000-1-1">总排行</a>
            </div>

            <br />
            <br clear="all" />

            <div id="statbody" style="overflow:hidden;_zoom:1">
                <div style="width:300px;float:left;">
                    <fieldset>
                        <legend>Top 10 销量排行</legend>
                        <ol>
                            <?php if($topsale['result']) foreach($topsale['result'] as $v):?>
                            <li><a href="/<?php echo $v['iid']?>" target="_blank"><?php echo $v['iname']?></a> - <?php echo $v['ct']?> 件</li>
                            <?php endforeach?>
                        </ol>
                    </fieldset>
                </div>
                <div style="width:300px;float:left;margin-left:30px">
                    <fieldset>
                        <legend>Top 10 销售额排行</legend>
                        <ol>
                            <?php if($topin['result']) foreach($topin['result'] as $v):?>
                            <li><a href="/<?php echo $v['iid']?>" target="_blank"><?php echo $v['iname']?></a> - <?php echo $v['ct']?> 元</li>
                            <?php endforeach?>
                        </ol>
                    </fieldset>
                </div>
                <div style="width:300px;float:left;margin-left:30px">
                    <fieldset>
                        <legend>Top 10 利润排行</legend>
                        <ol>
                            <?php if($topin2['result']) foreach($topin2['result'] as $v):?>
                            <li><a href="/<?php echo $v['iid']?>" target="_blank"><?php echo $v['iname']?></a> - <?php echo $v['ct']?> 元</li>
                            <?php endforeach?>
                        </ol>
                    </fieldset>
                </div>
            </div>


            <?php include VIEWS.'admin/runtime.html'?>

        </div>

        <script type="text/javascript">
            Element.addClassName('am5', 'current');
            $('_ia').style.height = document.documentElement.scrollHeight+'px';
        </script>

    </body>
</html>
